﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Detail.aspx.cs" Inherits="RioStudio.Website.View.Admin.Gallery.Detail" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div align="left" style="width: 953px; padding-top: 20px;">
        <div>
            <asp:Image ID="Image1" ImageUrl="~/Content/Images/gallery.png" runat="server" />
        </div>
        <div style="padding-top: 20px; padding-bottom: 20px;">
            <table border="0" cellpadding="10" cellspacing="10" style="border-spacing: 10px; border-collapse: separate">
                <tr>
                    <td>
                        Tên album
                    </td>
                    <td>
                        <asp:TextBox ID="txtGalleryName" runat="server" Width="400px" />
                    </td>
                </tr>
                <tr>
                    <td>
                        Ảnh đại diện
                    </td>
                    <td>
                        <asp:TextBox ID="txtAvatar" runat="server" Width="400px" />
                    </td>
                </tr>
                <tr>
                    <td>
                        Ngày chụp
                    </td>
                    <td>
                        <telerik:RadDatePicker ID="rdpGalleryDate" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td>
                        Nơi chụp
                    </td>
                    <td>
                        <asp:TextBox ID="txtGalleryPlace" runat="server" Width="400px" />
                    </td>
                </tr>
                <tr>
                    <td>
                        Ẩn
                    </td>
                    <td>
                        <asp:CheckBox ID="chkInactive" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td>
                        Thứ tự
                    </td>
                    <td>
                        <telerik:RadNumericTextBox ID="txtSortOrder" runat="server" Width="400px" NumberFormat-DecimalDigits="0" DataType="Int32" />
                    </td>
                </tr>
                <tr>
                    <td>
                        Album nổi bật
                    </td>
                    <td>
                        <asp:CheckBox ID="chkIsFeatured" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td>
                        Thứ tự
                    </td>
                    <td>
                        <telerik:RadNumericTextBox ID="RadNumericTextBox1" runat="server" Width="400px" NumberFormat-DecimalDigits="0" DataType="Int32" />
                    </td>
                </tr>
                <tr>
                    <td>
                        Diễn giải
                    </td>
                    <td>
                        <asp:TextBox ID="txtDescription" runat="server" TextMode="MultiLine" Width="400px" Style="resize: none" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Button ID="btnSave" runat="server" Text="Cất" OnClick="btnSave_Click" />
                        <asp:Button ID="btnAddImage" Text="Thêm ảnh" runat="server" OnClientClick="openWinContentTemplate(); return false;" Visible="false" />
                        <asp:HyperLink ID="lnkCancel" runat="server" Text="Hủy" NavigateUrl="/Album" />
                    </td>
                </tr>
            </table>
        </div>
        <telerik:RadWindow ID="RadWindow_ContentTemplate" Title="Ảnh" Width="400px" Height="300px" runat="server" DestroyOnClose="true" Modal="true">
            <ContentTemplate>
                <asp:HiddenField ID="hiddenImageID" runat="server" />
                <table border="0" cellpadding="10" cellspacing="10" style="border-spacing: 10px; border-collapse: separate">
                    <tr>
                        <td>
                            Tên ảnh
                        </td>
                        <td>
                            <asp:TextBox ID="txtImageName" runat="server" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Ảnh
                        </td>
                        <td>
                            <asp:TextBox ID="txtImageLink" runat="server" />
                        </td>
                    </tr>                   
                    <tr>
                        <td>
                            Ẩn
                        </td>
                        <td>
                            <asp:CheckBox ID="chkImageInactive" runat="server" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Thứ tự
                        </td>
                        <td>
                            <telerik:RadNumericTextBox ID="txtImageSortOrder" runat="server" DataType="System.Int32">
                                <NumberFormat DecimalDigits="0" />
                            </telerik:RadNumericTextBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Button ID="btnAdd" runat="server" Text="Thêm ảnh" OnClick="btnAdd_Click" />
                            <asp:Button ID="btnCancel" runat="server" Text="Hủy" />
                        </td>
                    </tr>
                </table>
            </ContentTemplate>
        </telerik:RadWindow>
        <script type="text/javascript">
            function openWinContentTemplate() {
                $find("<%= RadWindow_ContentTemplate.ClientID %>").show();
            }

        </script>
        <asp:Panel ID="panelImage" runat="server" Visible="false">
            <asp:DataList ID="dataTest" RepeatColumns="5" RepeatDirection="Horizontal" runat="server">
                <ItemTemplate>
                    <div style="margin: 5px 15px 10px 0">
                        <div>
                            <asp:Button ID="btnDeleteImage" runat="server" Text="Xóa" OnClientClick="return confirm('Có phải bạn muốn xóa bức ảnh này?');" OnClick="btnDeleteImage_Click" CommandArgument='<%# Eval("ImageID") %>' />
                        </div>
                        <div align="left">
                            <a class="image-clickable" rel="gallery" href='<%# ResolveUrl(Eval("ImageLink").ToString()) %>'>
                                <img src='/ImageHandler.axd?image=<%# ResolveUrl(Eval("ImageLink").ToString()) %>&Height=103&Width=168' alt='<%# Eval("ImageName") %>' />
                            </a>
                        </div>
                        <%--<div class="left">
                            <label>
                                Alt (trong thẻ img)</label><asp:TextBox ID="txtAlternativeText" runat="server" Text='<%# Eval("AlternativeText") %>' />
                        </div>--%>
                        <div class="times" align="left">
                            <%# Eval("ImageName") %>
                        </div>
                        <div style="clear: both">
                        </div>
                    </div>
                </ItemTemplate>
            </asp:DataList>
            <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
                <script type="text/javascript">
                    $(document).ready(function () {
                        $("a.image-clickable").fancybox();
                    });
                </script>
            </telerik:RadScriptBlock>
        </asp:Panel>
    </div>
</asp:Content>
